import Vue from 'vue'
import App from './App.vue'
//import login from './views/login/login.vue'
import router from './router'
import Antd from 'ant-design-vue/es'
import 'ant-design-vue/dist/antd.css'
import store from './store'
//ElementUI组件
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

// 图片放大缩小功能
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'

Vue.config.productionTip = false;
//Vue.prototype.$rootUrl = getRootUrl();
Vue.use(Antd)
Vue.use(ElementUI)
Vue.use(Viewer)
Viewer.setDefaults({
    Options: { "inline": true, "button": true, "navbar": true, "title": true, "toolbar": true, "tooltip": true, "movable": true, "zoomable": true, "rotatable": true, "scalable": true, "transition": true, "fullscreen": true, "keyboard": true, "url": "data-source" }
});

new Vue({
    router,
    //将创建的共享数据对象挂载到Vue实例中
    //所以的组件，就可以直接从store中获取全局的数据
    store,
    render: h => h(App),
    //render: h => h(login)
}).$mount('#app')

// function getRootUrl() {
//   const root = window.location.href;
//   return root.substring(0, root.indexOf('/#/') + 2);
// }